Skip to content

fix heap corruption in convert_string_for_dapi#38

Open
Brolijah wants to merge 1 commit into
dectalk:dectalk-developfrom
Brolijah:dectalk-develop
Open

fix heap corruption in convert_string_for_dapi#38
Brolijah wants to merge 1 commit into
dectalk:dectalk-developfrom
Brolijah:dectalk-develop

Conversation

@Brolijah
Copy link
Copy Markdown

@Brolijah Brolijah commented May 15, 2026

One line fix for heap corruption

wout = malloc(wbytes + sizeof(wchar_t));

Allocates one extra char for null terminator so wout[len] = 0; later doesn't write past the end of the buffer.

Crash behavior was discovered while implementing dectalkmini into an application. It would crash after a few speaks so I hooked it up to a debugger and traced it to this function.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant